package com.ruoyi.web.controller.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author : Xuzhaobo
 * @date : 2025-02-14 19:15
 * @description :
 **/
@Component
public class OssConfig {
    // 阿里云 OSS 访问密钥 ID
    private  String ACCESS_KEY_ID = "LTAI5tB6RFGb9CbyfhUJzkBS";
    // 阿里云 OSS 访问密钥 Secret
    private  String ACCESS_KEY_SECRET = "1G9kB78ApE1lRscJQYrup6ayBYjF5N";
    // 阿里云 OSS 存储空间名称
    private  String BUCKET_NAME = "xbo-2203aa";
    // 阿里云 OSS 访问端点
    private  String ENDPOINT = "https://oss-cn-beijing.aliyuncs.com";

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(ENDPOINT, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
    }

    public String getBucketName() {
        return BUCKET_NAME;
    }
}
